package com.naizhuai.ui.task.multtype;

import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.naizhuai.R;
import com.naizhuai.ui.rank.RankActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import me.drakeet.multitype.ItemViewBinder;

/**
 * @author：lichenxi
 * @date 2018/5/5 18
 * email：525603977@qq.com
 * Fighting
 */
public class VitalityShowViewBinder extends ItemViewBinder<VitalityShow, VitalityShowViewBinder.ViewHolder> {
    @NonNull
    @Override
    protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
        View root = inflater.inflate(R.layout.item_vitality_show, parent, false);
        return new ViewHolder(root);
    }

    @Override
    protected void onBindViewHolder(@NonNull ViewHolder holder, @NonNull VitalityShow vitalityShow) {
        holder.titleCount.setText(Html.fromHtml(vitalityShow.show));
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                RankActivity.start(holder.itemView.getContext(),RankActivity.RANK_TEAN);

            }
        });
    }

    static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.title_count)
        TextView titleCount;
        ViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
